#include <iostream>

using namespace std;

bool isPrime(unsigned long long num)
{
	for (unsigned long long count = 2; count < num; count++)
	{
		if (num % count == 0)
		{
			return false;
		}
	}

	return true;
}

void findFactor(unsigned long long num, unsigned long long factor)
{
	if ( isPrime(num) )
	{
		cout << num << " " << endl;
		return;
	}

	if (num % factor == 0)
	{
		cout << factor << " ";
		findFactor(num/factor, 2);
	}
	else
	{
		findFactor(num, factor + 1);
	}
}

int main()
{
	findFactor(600851475143, 2);
}